*12345678901234567890123456789012345678901234567890123456789012345678901234567890
capture log close
clear all
set more off

*	************************************************************************
* 	File-Name: 	ImpactEvaluationAnalysis.do
*	Log-file:	na
*	Date:  		04/20/2017
*	Author: 	Michaël Aklin, SP Harish, Patrick Bayer, and Johannes Urpelainen
*	Data Used:  ReplicationDataFinal.dta
*	Output		Tables, Figures, etc.
*	Purpose:   	.do file to do the analysis for the Science Advance article.
*	************************************************************************


*	************************************************************************
*	A. Coding do file
*	************************************************************************

*	Path to coding file. CHANGE CD HERE
*cd "."
quiet do "ReplicationImpactEvaluationCoding.do"

*	xtsetting
xtset Q11_hhid survey

*	************************************************************************
*	B.1 Summary stats
*	************************************************************************

*	Summary stats
preserve
eststo: estpost sum total_kerosene Q918_keroseneexpensesprivate Q916_keroseneexpenses hourselec Q179_lightcooking Q98_lightinghours Q91_electricity Q951_lightingsatis Q69_ownbusiness Q61_expenses Q62_savings Q1715_equalschool Q1714_equaljobopp Q1713_domesticviolence Q1712_evetease Q1711_lightsafer Q1710_lightgooutside Q32_age children religiond1 casted1 casted2 if remote == 0
esttab using "./ScienceAdSummaryStats.tex"	///
	, ///
	cells("mean(fmt(2)) sd(fmt(2)) min(fmt(0)) max(fmt(0)) count(fmt(0))") ///
	substitute(m$ m\\$)	///
	nonumber label replace unstack
eststo clear
restore

*	Lighting sources
estpost tabulate lighttype if survey == 1 & remote == 0
esttab using "./ScienceAdLightTab1.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 2 & remote == 0
esttab using "./ScienceAdLightTab2.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 3 & remote == 0
esttab using "./ScienceAdLightTab3.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear



*	Lighting sources by treatment
estpost tabulate lighttype if survey == 1 & remote == 0 & itt == 1
esttab using "./ScienceAdLightTab1Treat.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 2 & remote == 0 & itt == 1
esttab using "./ScienceAdLightTab2Treat.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 3 & remote == 0 & itt == 1
esttab using "./ScienceAdLightTab3Treat.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 1 & remote == 0 & itt == 0
esttab using "./ScienceAdLightTab1Cont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 2 & remote == 0 & itt == 0
esttab using "./ScienceAdLightTab2Cont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 3 & remote == 0 & itt == 0
esttab using "./ScienceAdLightTab3Cont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear


estpost tabulate lighttype if survey == 1 & remote == 1 & itt == 0
esttab using "./ScienceAdLightTab1RemCont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 2 & remote == 1 & itt == 0
esttab using "./ScienceAdLightTab2RemCont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

estpost tabulate lighttype if survey == 3 & remote == 1 & itt == 0
esttab using "./ScienceAdLightTab3RemCont.tex"	///
	, replace cells("b(label(freq)) pct(fmt(2))")       ///
	varlabels(, blist(Total "{hline @width}{break}")) ///
	varwidth(20) nonumber nomtitle noobs
eststo clear

*	Summary stats by wave
preserve
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 1 & group == 0
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 2 & group == 0
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 3 & group == 0
esttab using "./SummaryStatsWaveGroup0.tex", ///
	cells("mean(fmt(2))") ///
	substitute(m$ m\\$)	///
	nonumber label replace unstack
eststo clear
restore

preserve
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 1 & group == 1
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 2 & group == 1
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 3 & group == 1
esttab using "./SummaryStatsWaveGroup1.tex", ///
	cells("mean(fmt(2))") ///
	substitute(m$ m\\$)	///
	nonumber label replace unstack
eststo clear
restore

preserve
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 1 & group == 2
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 2 & group == 2
eststo: estpost sum Q61_expenses Q62_savings Q32_age children religiond1 casted1 casted2 total_kerosene Q918_keroseneexpensesprivate Q69_ownbusiness if survey == 3 & group == 2
esttab using "./SummaryStatsWaveGroup2.tex", ///
	cells("mean(fmt(2))") ///
	substitute(m$ m\\$)	///
	nonumber label replace unstack
eststo clear
restore

*	Table A4
*	MGP customers (can differ from sources of lighting)
sum Q11_hhid if tvadopted == 1 & survey == 1 & itt== 1
sum Q11_hhid if tvadopted == 1 & survey == 2 & itt== 1
sum Q11_hhid if tvadopted == 1 & survey == 3 & itt== 1

*	Treatment + installed
sum Q11_hhid if survey == 1 & itt == 1
sum Q11_hhid if survey == 2 & itt == 1
sum Q11_hhid if survey == 3 & itt == 1

*	HH in close control
sum Q11_hhid if survey == 1 & itt == 0 & remote == 0
sum Q11_hhid if survey == 2 & itt == 0 & remote == 0
sum Q11_hhid if survey == 3 & itt == 0 & remote == 0

*	HH in remote control
sum Q11_hhid if survey == 1 & itt == 0 & remote == 1
sum Q11_hhid if survey == 2 & itt == 0 & remote == 1
sum Q11_hhid if survey == 3 & itt == 0 & remote == 1

*	Total number of HH
sum Q11_hhid if survey == 1
sum Q11_hhid if survey == 2
sum Q11_hhid if survey == 3

*	Graphs
twoway (kdensity Q918_keroseneexpensesprivate if survey == 1 & remote == 0)	///
	,	///
	xtitle(Rupees per Month (Private Market))	///
	ytitle(Density)	///
	legend(col(3) label(1 "Baseline Data"))	///
	graphregion(fcolor(white))
graph export "./RRHistKerosenePrivateWave01.pdf", replace as(pdf)

twoway (kdensity Q916_keroseneexpenses if survey == 1 & remote == 0)	///
	,	///
	xtitle(Rupees per Month (PDS))	///
	ytitle(Density)	///
	legend(col(3) label(1 "Baseline Data"))	///
	graphregion(fcolor(white))
graph export "./RRHistKerosenePDSWave01.pdf", replace as(pdf)

twoway (kdensity hourselec if survey == 1 & remote == 0)	///
	,	///
	xtitle(Hours of Electricity (per Day))	///
	ytitle(Density)	///
	legend(col(3) label(1 "Baseline Data"))	///
	graphregion(fcolor(white))
graph export "./RRHistHoursElecWave01.pdf", replace as(pdf)




*	************************************************************************
*	B.2 Analysis
*	************************************************************************


*	************************************************************************
*	B.2.1 First order effects
*	************************************************************************

*	************************************************************************
*	B.2.1.0.1 Means of DVs/claims made in text
*	************************************************************************

sum Q918_keroseneexpensesprivate if survey == 1 & remote == 0
* 58-61% of a s.d.
di 100*38/65.32591
di 100*40/65.32591
* 23-26% of pre-treatment mean
di 100*17/73
di 100*19/73

sum total_kerosene if survey == 1 & remote == 0
di 100*17/108
di 100*19/108


*	Pre-treatment means (previously in the notes of each table; removed since)
sum Q916_keroseneexpenses if survey == 1 & remote == 0
sum total_kerosene  if survey == 1 & remote == 0

sum Q91_electricity if survey == 1 & remote == 0
sum hourselec if survey == 1 & remote == 0

sum Q62_savings if survey == 1 & remote == 0
sum Q61_expenses if survey == 1 & remote == 0
sum Q69_ownbusiness if survey == 1 & remote == 0
sum Q1718_worktime if survey == 1 & remote == 0
sum studydummy if survey == 1 & remote == 0
sum Q84_chargephone if survey == 1 & remote == 0


*	Pre-treatment control group mean for all outcome variables (in Table 1-3)
sum Q918_keroseneexpensesprivate Q916_keroseneexpenses total_kerosene Q91_electricity hourselec Q62_savings Q61_expenses Q69_ownbusiness Q1718_worktime studydummy Q84_chargephone if remote == 0 & treatment == 0 & survey == 1


*	************************************************************************
*	B.2.1.1 Kerosene
*	************************************************************************

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2) first
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2) first
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2) first
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


*	************************************************************************
*	B.2.1.2 Access to electricity
*	************************************************************************

eststo: reg Q91_electricity tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionEstimates.tex"	/// 
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg hourselec tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


*	************************************************************************
*	B.2.2 Socioeconomic effects
*	************************************************************************

eststo: xtreg Q62_savings tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q62_savings sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q61_expenses tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q61_expenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q69_ownbusiness tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q69_ownbusiness sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q1718_worktime tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg studydummy tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg studydummy sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q84_chargephone tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q84_chargephone sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace


esttab using "./ScienceAd2ndOrderEffectsEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" )	///
		mgroups("Savings" "Expenses" "Business" "Work Time" "Study" "Phone Charging", pattern(1 0 1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear



*	************************************************************************
*	B.3 Appendix
*	************************************************************************

*	************************************************************************
*	B.3.1 ScienceAdKeroseneByWaveEstimates
*	************************************************************************

eststo: reg Q918_keroseneexpensesprivate itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q918_keroseneexpensesprivate itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q918_keroseneexpensesprivate itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg Q916_keroseneexpenses itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q916_keroseneexpenses itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q916_keroseneexpenses itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg total_kerosene itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg total_kerosene itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg total_kerosene itt if sd3 == 1 & remote == 0, cluster(unique_id)

esttab using "./ScienceAdKeroseneByWaveEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3")	///
		mgroups("Private" "Public Kerosene" "Total Kerosene", pattern(1 0 0 1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))
eststo clear


*	************************************************************************
*	B.3.2 ScienceAdKeroseneFirstStage_MANUAL
*	Using ivreg2 and xtivreg2 instead of ivregress and xtivreg because
*	they give us directly the F statistic for the excluded instrument
*	************************************************************************

*	First stages for Table 1
ivreg2 Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, cluster(id2) first
xtivreg2 Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first

ivreg2 Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0, cluster(id2)  first
xtivreg2 Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first

ivreg2 total_kerosene sd* (tvinstalled=tvitt)  if remote == 0, cluster(id2) first
xtivreg2 total_kerosene sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first

*	First stages for Table 2
ivreg2 Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, cluster(id2)  first
xtivreg2 Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first

ivreg2 hourselec sd* (tvinstalled=tvitt) if remote == 0, cluster(id2)  first
xtivreg2 hourselec sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first

*	First stages for Table 3
xtivreg2 Q62_savings sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first 
xtivreg2 Q61_expenses sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first
xtivreg2 Q69_ownbusiness sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first
xtivreg2 Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first
xtivreg2 studydummy sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first
xtivreg2 Q84_chargephone sd* (tvinstalled=tvitt) if remote == 0, fe cluster(id2) first



*	************************************************************************
*	B.3.3 Lighting satisfaction
*	************************************************************************

eststo: reg lightsat tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg lightsat tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls lightsat sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg lightsat sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdLightingSatisfactionEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear	
	


*	************************************************************************
*	B.3.4 Hours of lighting
*	************************************************************************

eststo: reg Q98_lightinghours tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q98_lightinghours tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q98_lightinghours sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q98_lightinghours sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdHoursLightingEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear	



*	************************************************************************
*	B.3.5 W/O flooding
*	************************************************************************

preserve
drop if flooding==1

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateEstimateswoFlooding.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicEstimateswoFlooding.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalEstimateswoFlooding.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionwoFlooding.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: reg hourselec tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursEstimateswoFlooding.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

restore



*	************************************************************************
*	B.3.5 W/O contaminated villages
*	************************************************************************


preserve
drop if contamination==1

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateEstimateswoContaminated.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicEstimateswoContaminated.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalEstimateswoContaminated.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionEstimateswoContaminated.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: reg hourselec tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursEstimateswoContaminated.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


restore


*	************************************************************************
*	B.3.6 W/O suspicious case
*	************************************************************************

preserve
gen flag2 = 0
replace flag2 = 1 if unique_id == "35-1" & adopted == 1
drop if flag == 1

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateWO35-1Estimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicWO35-1Estimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2)
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalWO35-1Estimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionWO35-1Estimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg hourselec tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursWO35-1Estimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


restore



*	************************************************************************
*	B.3.8 All second order effects
*	************************************************************************

eststo: reg Q62_savings tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q62_savings tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q62_savings sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q62_savings sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdSavingsEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q61_expenses tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q61_expenses tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q61_expenses sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q61_expenses sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdExpenditureEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q69_ownbusiness tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q69_ownbusiness tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q69_ownbusiness sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q69_ownbusiness sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdBusinessEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q1718_worktime tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1718_worktime tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdWorkTimeEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg studydummy tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg studydummy tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls studydummy sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg studydummy sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdStudyingEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q84_chargephone tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q84_chargephone tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q84_chargephone sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q84_chargephone sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdPhoneChargingEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q84_chargephone tvitt Q91_elec sd* if remote == 0, cluster(id2)
eststo: xtreg Q84_chargephone tvitt Q91_elec sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q84_chargephone Q91_elec sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q84_chargephone Q91_elec sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdPhoneChargingEstimatesB.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q1715_equalschool tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1715_equalschool tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1715_equalschool sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1715_equalschool sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdEqualSchoolEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear


eststo: reg Q1714_equaljobopp tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1714_equaljobopp tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1714_equaljobopp sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1714_equaljobopp sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdEqualJobEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q1713_domesticviolence tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1713_domesticviolence tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1713_domesticviolence sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1713_domesticviolence sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdDomesticViolenceEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

eststo: reg Q1712_evetease tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1712_evetease tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1712_evetease sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1712_evetease sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdEveTeaseEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear


eststo: reg Q1711_lightsafer tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1711_lightsafer tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1711_lightsafer sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1711_lightsafer sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdLightSaferEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear


eststo: reg Q1710_lightgooutside tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1710_lightgooutside tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1710_lightgooutside sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1710_lightgooutside sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdLightGoOutsideEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

*	Same tables, but with dummy variable outcomes

gen Q1715_equalschoolD = .
replace Q1715_equalschoolD = 0 if Q1715_equalschool == 1 | Q1715_equalschool == 2
replace Q1715_equalschoolD = 1 if Q1715_equalschool == 3 | Q1715_equalschool == 4

eststo: reg Q1715_equalschoolD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1715_equalschoolD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1715_equalschoolD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1715_equalschoolD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdEqualSchoolEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear


gen Q1714_equaljoboppD = .
replace Q1714_equaljoboppD = 0 if Q1714_equaljobopp == 1 | Q1714_equaljobopp == 2
replace Q1714_equaljoboppD = 1 if Q1714_equaljobopp == 3 | Q1714_equaljobopp == 4

eststo: reg Q1714_equaljoboppD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1714_equaljoboppD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1714_equaljoboppD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1714_equaljoboppD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdEqualJobEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

gen Q1713_domesticviolenceD = .
replace Q1713_domesticviolenceD = 0 if Q1713_domesticviolence == 1
replace Q1713_domesticviolenceD = 1 if Q1713_domesticviolence == 2 | Q1713_domesticviolence == 3 | Q1713_domesticviolence == 4

eststo: reg Q1713_domesticviolenceD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1713_domesticviolenceD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1713_domesticviolenceD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1713_domesticviolenceD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdDomesticViolenceEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

gen Q1712_eveteaseD = .
replace Q1712_eveteaseD = 0 if Q1712_evetease == 1
replace Q1712_eveteaseD = 1 if Q1712_evetease == 2 | Q1712_evetease == 3 | Q1712_evetease == 4

eststo: reg Q1712_eveteaseD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1712_eveteaseD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1712_eveteaseD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1712_eveteaseD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdEveTeaseEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

gen Q1711_lightsaferD = .
replace Q1711_lightsaferD = 0 if Q1711_lightsafer == 2 | Q1711_lightsafer == 3
replace Q1711_lightsaferD = 1 if Q1711_lightsafer == 1 

eststo: reg Q1711_lightsaferD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1711_lightsaferD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1711_lightsaferD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1711_lightsaferD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdLightSaferEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear

gen Q1710_lightgooutsideD = .
replace Q1710_lightgooutsideD = 0 if Q1710_lightgooutside == 1 | Q1710_lightgooutside == 2 | Q1710_lightgooutside == 3
replace Q1710_lightgooutsideD = 1 if Q1710_lightgooutside == 4 | Q1710_lightgooutside == 5

eststo: reg Q1710_lightgooutsideD tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1710_lightgooutsideD tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1710_lightgooutsideD sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1710_lightgooutsideD sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdLightGoOutsideEstimates2.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)	///
	nomtitles
eststo clear


*	************************************************************************
*	B.3.9 Additional gender results (time spent working, cooking)
*	************************************************************************


eststo: reg Q1717_cooktime tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1717_cooktime tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1717_cooktime sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1717_cooktime sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdTimeCookingEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: reg Q1718_worktime tvitt sd* if remote == 0, cluster(id2)
eststo: xtreg Q1718_worktime tvitt sd* if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdTimeWorkingEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear





*	************************************************************************
*	B.3.10 Spillovers
*	************************************************************************

eststo: reg Q918_keroseneexpensesprivate tvitt tvremote sd*, cluster(id2)
test tvitt = tvremote
eststo: xtreg Q918_keroseneexpensesprivate tvitt tvremote sd*, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
test tvitt = tvremote
eststo: ivregress 2sls Q918_keroseneexpensesprivate tvremote sd* (tvinstalled=tvitt), vce(cluster id2)
test tvinstalled = tvremote
eststo: xtivreg Q918_keroseneexpensesprivate tvremote sd* (tvinstalled=tvitt), fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
test tvinstalled = tvremote

esttab using "./ScienceAdKerosenePrivateEstimatesSpill.tex",	///
	booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: reg Q916_keroseneexpenses tvitt tvremote sd* , cluster(id2)
test tvitt = tvremote
eststo: xtreg Q916_keroseneexpenses tvitt tvremote sd*, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
test tvitt = tvremote
eststo: ivregress 2sls Q916_keroseneexpenses tvremote sd* (tvinstalled=tvitt), vce(cluster id2)
test tvinstalled = tvremote
eststo: xtivreg Q916_keroseneexpenses tvremote sd* (tvinstalled=tvitt), fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
test tvinstalled = tvremote

esttab using "./ScienceAdKerosenePublicEstimatesSpill.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: reg total_kerosene tvitt tvremote sd* , cluster(id2)
test tvitt = tvremote
eststo: xtreg total_kerosene tvitt tvremote sd*, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
test tvitt = tvremote
eststo: ivregress 2sls total_kerosene tvremote sd* (tvinstalled=tvitt), vce(cluster id2)
test tvinstalled = tvremote
eststo: xtivreg total_kerosene tvremote sd* (tvinstalled=tvitt), fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
test tvinstalled = tvremote

esttab using "./RRScienceAdKeroseneTotalEstimatesSpill.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt tvremote sd* , cluster(id2)
test tvitt = tvremote
eststo: xtreg Q91_electricity tvitt tvremote sd*, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
test tvitt = tvremote
eststo: ivregress 2sls Q91_electricity tvremote sd* (tvinstalled=tvitt), vce(cluster id2)
test tvinstalled = tvremote
eststo: xtivreg Q91_electricity tvremote sd* (tvinstalled=tvitt), fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
test tvinstalled = tvremote
esttab using "./ScienceAdElectricityConnectionEstimatesSpill.tex"	/// 
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg hourselec tvitt tvremote sd*, cluster(id2)
test tvitt = tvremote
eststo: xtreg hourselec tvitt tvremote sd*, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
test tvitt = tvremote
eststo: ivregress 2sls hourselec tvremote sd* (tvinstalled=tvitt), vce(cluster id2)
test tvinstalled = tvremote
eststo: xtivreg hourselec tvremote sd* (tvinstalled=tvitt), fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
test tvinstalled = tvremote

esttab using "./ScienceAdElectricityHoursEstimatesSpill.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear



*	************************************************************************
*	B.3.11 W/o treatment habitations from the waiting list
*	************************************************************************

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0 & waiting_treatment == 0, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0 & waiting_treatment == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, vce(cluster id2)
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateEstimatesWOWaiting.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0 & waiting_treatment == 0, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0 & waiting_treatment == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0 & waiting_treatment == 0, vce(cluster id2)
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicEstimatesWOWaiting.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0 & waiting_treatment == 0, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0 & waiting_treatment == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0 & waiting_treatment == 0, vce(cluster id2)
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalEstimatesWOWaiting.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt sd* if remote == 0 & waiting_treatment == 0, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0 & waiting_treatment == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionEstimatesWOWaiting.tex"	/// 
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg hourselec tvitt sd* if remote == 0 & waiting_treatment == 0, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0 & waiting_treatment == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0 & waiting_treatment == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursEstimatesWOWaiting.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear



*	************************************************************************
*	B.3.12 2nd order effects by wave (split in 2 tables)
*	************************************************************************

eststo: reg Q62_savings itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q62_savings itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q62_savings itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg Q61_expenses itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q61_expenses itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q61_expenses itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg Q69_ownbusiness itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q69_ownbusiness itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q69_ownbusiness itt if sd3 == 1 & remote == 0, cluster(unique_id)

esttab using "./RRScienceAd2ndOrderWaveAEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3")	///
		mgroups("Savings" "Expenses" "Business", pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))
eststo clear


eststo: reg Q1718_worktime itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q1718_worktime itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q1718_worktime itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg studydummy itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg studydummy itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg studydummy itt if sd3 == 1 & remote == 0, cluster(unique_id)

eststo: reg Q84_chargephone itt if sd1 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q84_chargephone itt if sd2 == 1 & remote == 0, cluster(unique_id)
eststo: reg Q84_chargephone itt if sd3 == 1 & remote == 0, cluster(unique_id)

esttab using "./RRScienceAd2ndOrderWaveBEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3" "Wave 1" "Wave 2" "Wave 3")	///
		mgroups("Work Time" "Study" "Phone Charging", pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))
eststo clear


*	************************************************************************
*	B.3.13 Adopted LATE
*	************************************************************************

eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvadopted=tvitt) if remote == 0, vce(cluster id2) first
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvadopted=tvitt)  if remote == 0, vce(cluster id2) first
eststo: xtivreg Q916_keroseneexpenses sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvadopted=tvitt)  if remote == 0, vce(cluster id2) first
eststo: xtivreg total_kerosene sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneAdoptedLATE.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("Private Kerosene" "PDS" "Total", pattern(1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvadopted tvitt)
eststo clear


eststo: ivregress 2sls Q91_electricity sd* (tvadopted=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace	
eststo: ivregress 2sls hourselec sd* (tvadopted=tvitt) if remote == 0, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdElectricityAdoptedLATE.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("Electricity" "Hours of Elec.", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvadopted tvitt)
eststo clear


eststo: xtivreg Q62_savings sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q61_expenses sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q69_ownbusiness sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q1718_worktime sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg studydummy sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q84_chargephone sd* (tvadopted=tvitt) if remote == 0, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAd2ndOrderAdoptedLATE.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("Savings" "Exp." "Business" "Work Time" "Study" "Phone")	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvadopted tvitt)
eststo clear


*	************************************************************************
*	B.3.14 W/o HH with 24 hours electricity
*	************************************************************************

eststo: reg Q918_keroseneexpensesprivate tvitt sd* if remote == 0 & hourselec != 24, cluster(id2)
eststo: xtreg Q918_keroseneexpensesprivate tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, vce(cluster id2) first
eststo: xtivreg Q918_keroseneexpensesprivate sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePrivateEstimatesWO24.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q916_keroseneexpenses tvitt sd*  if remote == 0 & hourselec != 24, cluster(id2)
eststo: xtreg Q916_keroseneexpenses tvitt sd*  if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q916_keroseneexpenses sd* (tvinstalled=tvitt)  if remote == 0 & hourselec != 24, vce(cluster id2) first
eststo: xtivreg Q916_keroseneexpenses sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdKerosenePublicEstimatesWO24.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg total_kerosene tvitt sd*  if remote == 0 & hourselec != 24, cluster(id2)
eststo: xtreg total_kerosene tvitt sd*  if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls total_kerosene sd* (tvinstalled=tvitt)  if remote == 0 & hourselec != 24, vce(cluster id2) first
eststo: xtivreg total_kerosene sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneTotalEstimatesWO24.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg Q91_electricity tvitt sd* if remote == 0 & hourselec != 24, cluster(id2)
eststo: xtreg Q91_electricity tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls Q91_electricity sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, vce(cluster id2)
eststo: xtivreg Q91_electricity sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
esttab using "./ScienceAdElectricityConnectionEstimatesWO24.tex"	/// 
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear

eststo: reg hourselec tvitt sd* if remote == 0 & hourselec != 24, cluster(id2)
eststo: xtreg hourselec tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls hourselec sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, vce(cluster id2)
eststo: xtivreg hourselec sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAdElectricityHoursEstimatesWO24.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear


eststo: xtreg Q62_savings tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q62_savings sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q61_expenses tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q61_expenses sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q69_ownbusiness tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q69_ownbusiness sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q1718_worktime tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q1718_worktime sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg studydummy tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg studydummy sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtreg Q84_chargephone tvitt sd* if remote == 0 & hourselec != 24, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: xtivreg Q84_chargephone sd* (tvinstalled=tvitt) if remote == 0 & hourselec != 24, fe vce(cluster id2)
	estadd local hhfe "$\checkmark$" , replace

esttab using "./ScienceAd2ndOrderEffectsEstimatesWO24.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mtitles("ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" "ITT" "LATE" )	///
		mgroups("Savings" "Expenses" "Business" "Work Time" "Study" "Phone Charging", pattern(1 0 1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*", label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear



*	************************************************************************
*	B.3.15 Switch away from kerosene for lighting
*	Note: kerosene=1
*	************************************************************************

gen kerolight=0
replace kerolight=1 if Q95_lightingsource == 2

eststo: reg kerolight tvitt sd*  if remote == 0, cluster(id2)
eststo: xtreg kerolight tvitt sd*  if remote == 0, fe cluster(id2)
	estadd local hhfe "$\checkmark$" , replace
eststo: ivregress 2sls kerolight sd* (tvinstalled=tvitt)  if remote == 0, vce(cluster id2) first
eststo: xtivreg kerolight sd* (tvinstalled=tvitt) if remote == 0, fe vce(cluster id2) first
	estadd local hhfe "$\checkmark$" , replace

esttab using "./RRScienceAdKeroseneLightEstimates.tex"	///
	,  booktabs label replace ///
 	nodepvars se(2) b(2) ///
	star(* 0.10 ** 0.05 *** 0.01) ///
	substitute(m$ m\\$)	///
	compress nogaps scalars("rmse $\hat{\sigma}$" "hhfe Household FE" "N_g $\#$ Households") r2(2) sfmt(%9.2f %9.0f) ///
	mgroups("ITT (OLS)" "LATE (IV)", pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))	///
	indicate("Wave FE = sd*" , label($\checkmark$ ))	///
	rename(tvinstalled tvitt)
eststo clear





